package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.MyBook;
import com.ruoyi.system.domain.vo.MyBookQueryVo;
import com.ruoyi.system.mapper.MyBookMapper;
import com.ruoyi.system.service.IMyBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class MyBookServiceImpl extends ServiceImpl<MyBookMapper,MyBook> implements IMyBookService {

    @Autowired
    private MyBookMapper myBookMapper;

    @Override
    public List<MyBook> getAll(MyBookQueryVo myBookQueryVo) {
        return myBookMapper.findAll(myBookQueryVo);
    }

    @Override
    public MyBook getByIdWithSub(Integer bookId) {
        return myBookMapper.findByIdWithSub(bookId);
    }

    @Override
    public List<Map<String, Integer>> getSubScribeCount() {
        return myBookMapper.findSubScribeCount();
    }

}
